/*
 * StrLib.h
 * VB Script Analyzer
 * @author Gregoire JACOB (gregoire.jacob@orange-ftgroup.com)
 * @date 21/01/2008
 * @version 1.0
 * Basic functions on character and strings to analyze a file.
 */

/**
 * parseString()
 * @param The script file in input
 * @param The parsed string
 * @return The delimiter character encountered
 * Parse the file until a delimiter is reached.
 * Encountered blanks are skipped.
 */
char parseString(FILE * script, char * str);

/**
 * decomposeLine()
 * @param The line to decompose ended by '\n'
 * @param The table of tokens receiving the line
 * @param The number of lines in the tokens table
 * @param The number of columns in the tokens table
 * Parse the line for separated tokens.
 */
#define TOKENSIZE    200
#define TOKENMAXNB   80
#define ACCESS(tab,ind) &tab[(ind)*TOKENSIZE]
int decomposeLine(char * line, char * tokens, int lines, int columns);

/**
 * fgetAlignedLine()
 * @param The string receiving the line
 * @param The string maximum length
 * @param The file in input
 * Read a whole line without preliminari blank and tabs
 */
void fgetAlignedLine(char * line,int length, FILE * file);

/**
 * normalizeLine
 * @param The line to nromalize
 * Normalize a line by evaluating chr and merging strings
 */
void normalizeLine(struct LINE * line);

//Comparisons non sensitive to case
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *s1, const char *s2, size_t n);
char * strcasestr (char *haystack, char *needle);
//String processing
void unquote(char * string);
//Character translation
char getCharacter(int n);//ASCII
